package com.elf.zero.widget;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.util.AttributeSet;

import androidx.annotation.Nullable;

/**
 * 矩形指示器
 */
public class RectIndicator extends AbsIndicator {

    public RectIndicator(Context context) {
        super(context);
    }

    public RectIndicator(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    protected void init() {
        super.init();
        mItemWidth = 20;
        mItemHeight = 7;

        mNormalColor = Color.BLACK;
        mSelectedColor = Color.RED;
    }

    @Override
    protected void drawIndicator(Canvas canvas, int x, int width, int height, Paint paint) {
        canvas.drawRect(x, 0, x + width, height, paint);
    }
}
